#include "FdInfo.h"

FdInfo::FdInfo()
{
}

FdInfo::FdInfo(int fd, int event, callback readcallback, callback writecallback, callback destroycallback, void *arg)
{
    this->m_fd=fd;
    this->readcallback=readcallback;
    this->destroycallback=destroycallback;
    this->writecallback=writecallback;
    this->m_arg=arg;
    this->m_event=event;
}

FdInfo::~FdInfo()
{
    
}

void FdInfo::changeEvent(Event event)
{
    if(event==Event::READEVENT){
        m_event=static_cast<int>(Event::READEVENT);
    }
    else if(event==Event::WRITEEVENT){
        m_event=static_cast<int>(Event::WRITEEVENT);
    }
    else if(event==Event::DESTROYEVENT){
        m_event=static_cast<int>(Event::DESTROYEVENT);
    }
}
